import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';

/**
 * 获取存储
 * @param fd 固定参数
 * @param key 键
 * @see [api](https://dfeidao.gitee.io/feidao-web/browser/local)
 * @example
 * ```ts
 * import get from '@dfeidao/atom-mobile/local/get';
 * const value = get(fd, 'key');
 * ```
 */

export default function get<T>(fd: IFeidaoAiMobile, key: string) {
	const local = fd.local as { [key: string]: unknown; };
	return local && local[key] as T;
}
